package com.jj.service.impl;

import com.jj.dao.OrderDao;
import com.jj.service.OrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Service;

@Service
public class OrderServiceImpl implements OrderService {

    private final OrderDao orderDaoImpl;
    private final OrderDao orderNewDaoImpl;

    @Autowired
    public OrderServiceImpl(
            @Qualifier("orderDaoImpl") OrderDao orderDaoImpl,  // 注意大小写匹配
            @Qualifier("orderNewDaoImpl") OrderDao orderNewDaoImpl) {
        this.orderDaoImpl = orderDaoImpl;
        this.orderNewDaoImpl = orderNewDaoImpl;
    }

    @Override
    public void syncOrder() {
        orderDaoImpl.syncOrder();
        orderNewDaoImpl.syncOrder();
    }
}
